﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Content.Master" Inherits="System.Web.Mvc.ViewPage<MethodWorx.CMS.UI.Areas.Dashboard.Models.TemplateInstallModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script language="javascript">
        $(document).ready(function () {
            $("#install").click(function () {
                //  ok, hide the please wait
                MethodWorx.CMS.showPleaseWait();
            });
        });
    </script>
    <%using (Html.BeginForm())
      {%>
      <%=Html.Hidden("step", Model.CurrentStepIndex) %>
      <%=Html.Hidden("macro", Model.Macro) %>
    <h3>Step <%=(Model.CurrentStepIndex + 1)%> of <%=Model.TotalSteps%></h3>

    <%
          foreach (var prompt in Model.CurrentStep.Prompts)
          {%>
        <div class="formItem">
            <label><%=prompt.Prompt%></label>
            <%switch(prompt.Type.ToLower())
{
                  case "textbox":%>
               <%=Html.TextBox("prompts." + prompt.Variable, prompt.Value)%>
            <%
        break;
                  case "pagesbytemplate":%>
                      <%=Html.DropDownList("prompts." + prompt.Variable, this.Model.GetPagesByTemplateSelectList(prompt.Parameters["template"]), "-- Please Select --")%>
                      <%
        break;
}%>
<%=Html.ValidationMessage("prompts." + prompt.Variable)%>
        </div>
    <%
          }%>

        <div class="formItem">
            <%
          if (Model.IsLastStep)
          {%>
                <button type="submit" name="submit" id="install" value="install"><%=this.Model.Macro ? "Run Macro >>" : "Install >>"%></button>
            <%
          }
          else
          {%><button type="submit" name="submit" value="next">Next >></button><%
          }
%>
            <button type="submit" name="submit" value="cancel">Cancel</button>
        </div>
<%
      }%>
</asp:Content>
